<?php

declare(strict_types=1);

namespace App\CustHub\Model;

use Mine\MineModel;

/**
 * @property int $id 
 * @property int $uid 
 * @property int $main_uid 
 * @property int $robot_id 
 * @property int $status 自动接受群邀请:0=禁用 1=启用
 * @property int $accept_total 总接受人数
 * @property int $delay_accept_limit 每日接受上限
 * @property array $accept_interval 接受间隔
 * @property int $sleep_switch 休眠时间段开关：0=关 1=开
 * @property array $sleep_rules 休眠时间段规则
 * @property \Carbon\Carbon $created_at 
 * @property \Carbon\Carbon $updated_at 
 */
class ChRoomInviteAcceptConfig extends MineModel
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ch_room_invite_accept_config';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = ['id', 'uid', 'main_uid', 'robot_id', 'status', 'accept_total', 'delay_accept_limit', 'accept_interval', 'sleep_switch', 'sleep_rules', 'created_at', 'updated_at'];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'uid' => 'integer', 'main_uid' => 'integer', 'robot_id' => 'integer', 'status' => 'integer', 'accept_total' => 'integer', 'delay_accept_limit' => 'integer', 'accept_interval' => 'array', 'sleep_switch' => 'integer', 'sleep_rules' => 'array', 'created_at' => 'datetime', 'updated_at' => 'datetime'];

    public function robot(): \Hyperf\Database\Model\Relations\BelongsTo
    {
        return $this->belongsTo(ChRobot::class, 'robot_id', 'id');
    }
}
